<?php

date_default_timezone_set('Europe/Minsk');
setlocale(LC_ALL, "ru_RU.UTF-8");
mb_internal_encoding("UTF-8");
error_reporting(-1);
ini_set('display_errors', 'on');

$globalConfig = array();

$globalConfig['storage'] = array(
	'master' => array(
		'dbhost' => 'localhost',
		'dbname' => 'bike',
		'dbuser' => 'bike',
		'dbpass' => 'bike',
		'driver' => 'PDO_MYSQL',
		'options' => array(),
		'initialQuery' => 'SET NAMES UTF8',
	),

	'slaves' => array(
		array(
			'dbhost' => 'localhost',
			'dbname' => 'bike',
			'dbuser' => 'bike',
			'dbpass' => 'bike',
			'driver' => 'PDO_MYSQL',
			'options' => array(),
			'initialQuery' => 'SET NAMES UTF8',
		 )
	)
);


$globalConfig['sites'] = array(
	'default' => 'default',
	'bike.chrome.net' => 'default'
);


$globalConfig['entities'] = array(
	'site_tree' => array(
		'type'   => 'Tree_NestedSets',
		'fields'	=> array(
			'label' => array('type' => 'string', 'title' => 'Label', 'mandatory' => true),
			'title' => array('type' => 'string', 'title' => 'Title', 'mandatory' => true),
			'template' => array('type' => 'string', 'title' => 'Template', 'mandatory' => true),
			'acl'   => array('type' => 'integer', 'title' => 'Access rights'),
			'tags' => array('type' => 'string', 'title' => 'Tags'),
			'template_engine' => array('type' => 'int', 'title' => 'Template engine')
		)
	),
	'site_tree_content' => array(
		'type'  => 'List',
		'fields' => array(
			'nodeId' => array('type' => 'integer', 'title' => 'Id of node'),
			'label' => array('type' => 'string', 'title' => 'Label of field'),
			'content' => array('type' => 'text', 'title' => 'Content')
		),
	),
	'users' => array(
		'type'  => 'List',
		'fields'	=> array(
			'login' => array('type' => 'string', 'title' => 'Login', 'mandatory' => true),
			'password' => array('type' => 'password', 'title' => 'Password', 'mandatory' => true),
			'firstName' => array('type' => 'string', 'title' => 'First name', 'mandatory' => true),
			'lastName' => array('type' => 'string', 'title' => 'Last name', 'mandatory' => true),
		)
	)
);
